//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995-1999  Microsoft Corporation

Module Name:

secur.h

Abstract:


Notes:


--*/
/*
------------------------------------------------------------------------------
    Revision History
    Date                Author          Activity ID              Activity Headline
    2007-04-11     qinxuetao     CEDB200051438         Add +CPINC and +CPIN2
    2007-10-12     Wangxiaogang  WM600019541           Add PIN required UI when dialing
    2008-01-17     Chenjianjun   WM600029490           Adding the SIM Lock function for Lampson.
------------------------------------------------------------------------------
*/
#pragma once


#define SECUR_CMDBUF_LENGTH      (MAX_PATH + 2 * MAXLENGTH_PASSWORD)


//
// Locked states
//
const LPCSTR g_rgszLockedStates[] =
{
    "",                 // RIL_LOCKEDSTATE_UNKNOWN
    "READY",            // RIL_LOCKEDSTATE_READY
    "SIM PIN",          // RIL_LOCKEDSTATE_SIM_PIN
    "SIM PUK",          // RIL_LOCKEDSTATE_SIM_PUK
    "PH-SIM PIN",       // RIL_LOCKEDSTATE_PH_SIM_PIN
    "PH-FSIM PIN",      // RIL_LOCKEDSTATE_PH_FSIM_PIN
    "PH-FSIM PUK",      // RIL_LOCKEDSTATE_PH_FSIM_PUK
    "SIM PIN2",         // RIL_LOCKEDSTATE_SIM_PIN2
    "SIM PUK2",         // RIL_LOCKEDSTATE_SIM_PUK2
    "PH-NET PIN",       // RIL_LOCKEDSTATE_PH_NET_PIN
    "PH-NET PUK",       // RIL_LOCKEDSTATE_PH_NET_PUK
    "PH-NETSUB PIN",    // RIL_LOCKEDSTATE_PH_NETSUB_PIN
    "PH-NETSUB PUK",    // RIL_LOCKEDSTATE_PH_NETSUB_PUK
    "PH-SP PIN",        // RIL_LOCKEDSTATE_PH_SP_PIN
    "PH-SP PUK",        // RIL_LOCKEDSTATE_PH_SP_PUK
    "PH-CORP PIN",      // RIL_LOCKEDSTATE_PH_CORP_PIN
    "PH-CORP PUK",      // RIL_LOCKEDSTATE_PH_COPR_PUK
    "PH-NET PIN BLOCK", // RIL_LOCKEDSTATE_PH_NET_PIN BLOCK
};
#define NUM_LOCKEDSTATES     (sizeof(g_rgszLockedStates) / sizeof(LPCSTR) - 1)


//
// Lock facilities
//
static const LPCSTR g_rgszLockFacilities[] =
{
    "",     // 0
    "CS",   // RIL_LOCKFACILITY_CNTRL
    "PS",   // RIL_LOCKFACILITY_PH_SIM
    "PF",   // RIL_LOCKFACILITY_PH_FSIM
    "SC",   // RIL_LOCKFACILITY_SIM
    "P2",   // RIL_LOCKFACILITY_SIM_PIN2
    "FD",   // RIL_LOCKFACILITY_SIM_FIXEDIALING
    "PN",   // RIL_LOCKFACILITY_NETWORKPERS
    "PU",   // RIL_LOCKFACILITY_NETWORKSUBPERS
    "PP",   // RIL_LOCKFACILITY_SERVICEPROVPERS
    "PC",   // RIL_LOCKFACILITY_CORPPERS

};
#define NUM_LOCKFACILITIES    (sizeof(g_rgszLockFacilities) / sizeof(LPCSTR))


//
// Call barring types
//
static const LPCSTR g_rgszBarringTypes[] =
{
    "",     // 0
    "AO",   // RIL_BARRTYPE_ALLOUTGOING
    "OI",   // RIL_BARRTYPE_OUTGOINGINT
    "OX",   // RIL_BARRTYPE_OUTGOINGINTEXTOHOME
    "AI",   // RIL_BARRTYPE_ALLINCOMING
    "IR",   // RIL_BARRTYPE_INCOMINGROAMING
    "NS",   // RIL_BARRTYPE_INCOMINGNOTINSIM
    "AB",   // RIL_BARRTYPE_ALLBARRING
    "AG",   // RIL_BARRTYPE_ALLOUTGOINGBARRING
    "AC",   // RIL_BARRTYPE_ALLINCOMINGBARRING

};
#define NUM_BARRINGTYPES    (sizeof(g_rgszBarringTypes) / sizeof(LPCSTR))


HRESULT RILDrv_GetUserIdentity(DWORD dwParam);
HRESULT RILDrv_GetPhoneLockedState(DWORD dwParam);
HRESULT RILDrv_UnlockPhone(DWORD dwParam, LPCSTR lpszPassword, LPCSTR lpszNewPassword);
HRESULT RILDrv_GetLockingStatus(DWORD dwParam, DWORD dwFacility, LPCSTR lpszPassword);
HRESULT RILDrv_SetLockingStatus(DWORD dwParam, DWORD dwFacility, LPCSTR lpszPassword, DWORD dwStatus);
HRESULT RILDrv_ChangeLockingPassword(DWORD dwParam, DWORD dwFacility, DWORD dwOldPasswordType, LPCSTR lpszOldPassword, LPCSTR lpszNewPassword);
HRESULT RILDrv_GetCallBarringStatus(DWORD dwParam, DWORD dwType, DWORD dwInfoClass, LPCSTR lpszPassword);
HRESULT RILDrv_SetCallBarringStatus(DWORD dwParam, DWORD dwType, DWORD dwInfoClass, LPCSTR lpszPassword, DWORD dwStatus);
HRESULT RILDrv_ChangeCallBarringPassword(DWORD dwParam, DWORD dwType, LPCSTR lpszOldPassword, LPCSTR lpszNewPassword);
void RILSecSetPinRequiredFlag(bool flag);
BOOL RILSecGetPinRequiredFlag(void);

#ifdef WAVECOM_DRIVER
extern DWORD g_PhoneLockedStatus;
#endif 
